package com.ssy.lingxi.order.model.vo.platform.response;

import com.ssy.lingxi.order.model.constant.BuyerInnerStatusEnum;
import com.ssy.lingxi.order.model.constant.OrderMemberTypeEnum;
import com.ssy.lingxi.order.model.constant.OrderOperationEnum;
import com.ssy.lingxi.order.model.constant.VendorInnerStatusEnum;
import com.ssy.lingxi.order.utils.NumberUtil;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 平台后台 - 日志中心 - 查询订单内部历史记录返回
 * @author 万宁
 * @version 2.0.0
 * @date 2021-12-04
 */
public class PlatformOrderInnerHistoryVO implements Serializable {
    private static final long serialVersionUID = 8715076236553537103L;

    public PlatformOrderInnerHistoryVO(String orderNo, LocalDateTime createTime, String operator, String organizationName, String jobTitle, Integer memberType, Integer statusCode, String statusName, Integer operateCode, String operation, String remark) {
        this.orderNo = orderNo;
        this.createTime = createTime == null ? "" : createTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
        this.operator = operator;
        this.organizationName = organizationName;
        this.jobTitle = jobTitle;
        this.statusName = (NumberUtil.isNullOrZero(memberType) || NumberUtil.isNullOrZero(statusCode)) ? statusName : (memberType.equals(OrderMemberTypeEnum.BUYER.getCode()) ? BuyerInnerStatusEnum.getNameByCode(statusCode) : VendorInnerStatusEnum.getNameByCode(statusCode));
        this.operation = NumberUtil.isNullOrZero(operateCode) ? operation : OrderOperationEnum.getNameByCode(operateCode);
        this.remark = remark;
    }

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 操作时间，格式为yyyy-MM-dd HH:mm
     */
    private String createTime;

    /**
     * 操作人
     */
    private String operator;

    /**
     * 部门
     */
    private String organizationName;

    /**
     * 职位
     */
    private String jobTitle;

    /**
     * 状态名称
     */
    private String statusName;

    /**
     * 操作
     */
    private String operation;

    /**
     * 备注说明
     */
    private String remark;

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public String getOrganizationName() {
        return organizationName;
    }

    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }

    public String getJobTitle() {
        return jobTitle;
    }

    public void setJobTitle(String jobTitle) {
        this.jobTitle = jobTitle;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public String getOperation() {
        return operation;
    }

    public void setOperation(String operation) {
        this.operation = operation;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
